package com.ycg.store.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycg.store.common.Result;
import com.ycg.store.pojo.Warehouse;
import com.ycg.store.service.WarehouseService;
import com.ycg.store.mapper.WarehouseMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author lenovo
* @description 针对表【warehouse(仓库表)】的数据库操作Service实现
* @createDate 2024-05-24 20:04:33
*/
@Service
public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse>
    implements WarehouseService{

    /**
     * 根据租户id获取仓库
     *
     * @param id 租户id
     * @return List<Warehouse>
     */
    @Override
    public Result<List<Warehouse>> getByTenantId(String id) {
        LambdaQueryWrapper<Warehouse> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Warehouse::getTenantId,id);
        List<Warehouse> list = list(wrapper);
        return Result.ok(list);
    }

}




